<extend name="Public/base"/>

<block name="style">
	<link rel="stylesheet" href="__STATIC__/plugins/data-tables/DT_bootstrap.css" />
</block>

<block name="body">

	<div class="row">
        <div class="col-md-12">
            
            <div class="tabbable tabbable-custom boxless">
                <ul class="nav nav-tabs">
                    <li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
                    <li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
                    <li class="active"><a href="javascript:;">成员授权</a></li>
                </ul>
                
                <div class="tab-content">
                    
                    <div class="portlet box blue">
                        <div class="portlet-title">
                            <div class="caption"><i class="fa fa-reorder"></i>成员授权</div>
                            <div class="tools">
                                <select name="group">
                                    <volist name="auth_group" id="vo">
                                        <option value="{:U('AuthManager/user',array('group_id'=>$vo['id'],'group_name'=>$vo['title']))}" <eq name="vo['id']" value="$this_group['id']">selected</eq> >{$vo.title}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="portlet-body form">
                        
                        	 <div class="form-body">
                                
                                <table class="table table-striped table-bordered table-hover" id="sample">
                                    <thead>
                                        <tr>
                                            <th class="">UID</th>
                                            <th class="">昵称</th>
                                            <th class="">最后登录时间</th>
                                            <th class="">最后登录IP</th>
                                            <th class="">状态</th>
                                            <th class="">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <volist name="_list" id="vo">
                                        <tr>
                                            <td>{$vo.uid} </td>
                                            <td>{$vo.nickname}</td>
                                            <td><span>{$vo.last_login_time|time_format}</span></td>
                                            <td><span>{$vo.last_login_ip|long2ip}</span></td>
                                            <td>{$vo.status_text}</td>
                                            <td><a href="{:U('AuthManager/removeFromGroup?uid='.$vo['uid'].'&group_id='.I('group_id'))}" class="ajax-get">解除授权</a>
                                
                                                </td>
                                        </tr>
                                        </volist>
                                    </tbody>
                                </table>
                                
                                <!-- 分页 -->
                                <div class="page">
                                    {$_page}
                                </div>
                                
                            </div>
                            <!-- BEGIN FORM-->
               				<form class="add-user form-horizontal" action="{:U('addToGroup')}" method="post" enctype="application/x-www-form-urlencoded" >
                            
                                <div class="form-actions fluid ">
                                    <div class="col-md-9">
                                        <input type="hidden" name="group_id" value="{:I('group_id')}"> 
                                        
                                        <div class="form-group">
                                            <div class="col-md-4">
                                                <input class="form-control input-large"  type="text" name="uid" placeholder="请输入uid,多个用英文逗号分隔">
                                            </div>
                                            <label  class="col-md-3">
                                            	<button type="submit" class="btn green ajax-post" target-form="add-user">新 增</button>  
                                            </label>
                                        </div>                  
                                    </div>
                                </div>
                            </form>
                            <!-- END FORM--> 
                        </div>
                    </div>
                        
                </div>
            </div>
        </div>
    </div>
    
</block>


<block name="script">
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/jquery.dataTables.js"></script>
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/DT_bootstrap.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="__STATIC__/scripts/app.js"></script>
	<script src="__STATIC__/scripts/table-managed.js"></script>     
	<script>
		jQuery(document).ready(function() {       
		     App.init();
		     TableManaged.init();

             highlight_subnav('{:U('AuthManager/index')}');
			 
			$('select[name=group]').change(function(){
				location.href = this.value;
			});
		});
	</script>
</block>
